package com.example.tool.widget;

import android.content.Context;
import android.support.annotation.Nullable;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.example.tool.R;

import butterknife.BindView;
import butterknife.ButterKnife;

/**
 * Created by liangkun on 2018/8/20.
 * 作用:运动最近3天数据view
 */

public class SportCountLatelyCardView extends LinearLayout {
    @BindView(R.id.rv_last_3ays_count)
    protected CustomCountRecylerView rvLastCount; //最近3次运动
    @BindView(R.id.tv_check_all)
    protected TextView tvCheckAll; //查看全部记录
//    protected SportCountAdapter sportCountAdapter; //运动统计适配器
//    private List<SportCountVo> sportCountVos;
    private Context context;

    public SportCountLatelyCardView(Context context) {
        this(context, null);
    }

    public SportCountLatelyCardView(Context context, @Nullable AttributeSet attrs) {
        this(context, attrs, 0);
    }

    public SportCountLatelyCardView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
        initView(context);
    }

    private void initView(Context context) {
        this.context = context;
        LayoutInflater.from(context).inflate(R.layout.activity_item_count_lastly, this);
        ButterKnife.bind(this);
        tvCheckAll.setOnClickListener(new OnClickListener() {
            @Override
            public void onClick(View v) {
//                Intent intent = new Intent(context, HistoryActivity.class);
//                context.startActivity(intent);
            }
        });


    }

//    /**
//     * 设置数据
//     *
//     * @param sportCountVos 数据
//     */
//    public void setRvLastCount(List<SportCountVo> sportCountVos) {
////        this.sportCountVos = sportCountVos;
//////        rvLastCount.setNestedScrollingEnabled(false);
////        sportCountAdapter = new SportCountAdapter(getContext(), sportCountVos);
////        rvLastCount.setLayoutManager(new LinearLayoutManager(getContext()));
////        rvLastCount.setAdapter(sportCountAdapter);
//
//    }

}
